<#-- This is a Freemarker Template for generating Service Implementation Files for the application -->
<#-- This code is INCOMPLETE -->

package ${appNamespace}.${component.name}.dao.impl;

import java.util.List;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import ${appNamespace}.${component.name}.dao.${clazz.className}Dao;


public class ${clazz.className}DaoImpl extends SqlMapClientDaoSupport implements ${clazz.className}Dao {

	public ${clazz.className} getById(${clazz.attributeList[0].javaDataType} id) throws DataAccessException {
		return (List<${clazz.className}>) getSqlMapClientTemplate().queryForObject("get${clazz.className}ById",id});
	}
	
	public List<${clazz.className}> getListByCriteria(${clazz.className} ${clazz.className?uncap_first}) throws DataAccessException {
		return (List<${clazz.className}>) getSqlMapClientTemplate().queryForList("get${clazz.className}ListByCriteria",${clazz.className?uncap_first});
	}
	
	public void create(${clazz.className} ${clazz.className?uncap_first}) throws DataAccessException {
		getSqlMapClientTemplate().insert("insert${clazz.className}", ${clazz.className?uncap_first});
	}
	
	public void update(${clazz.className} ${clazz.className?uncap_first}) throws DataAccessException {
		getSqlMapClientTemplate().update("update${clazz.className}", ${clazz.className?uncap_first}, 1);
	}
	
	public void deleteById(${clazz.attributeList[0].javaDataType} id) throws DataAccessException {
		getSqlMapClientTemplate().delete("delete${clazz.className}", id});
	}
}